//
//  Commodity_Detail_ViewController.m
//  pmmSS
//
//  Created by Mac book on 2017/9/18.
//  Copyright © 2017年 WTFSSD. All rights reserved.
//

#import "Commodity_Detail_ViewController.h"
#import "Appraisee_ViewController.h"
#import "Commodity_ViewController.h"
#import "Detail_ViewController.h"

@interface Commodity_Detail_ViewController ()


@end

@implementation Commodity_Detail_ViewController

-(void)viewDidAppear:(BOOL)animated{
    [super viewDidAppear:animated];

    [self setUpNavBar];

}
-(void)viewDidLoad{

    [super viewDidLoad];


    self.currentIndex = 0;
    self.controllerClassNames=@"Commodity_ViewController,Detail_ViewController,Appraisee_ViewController";
    [self setTitles:@[@"商品",@"详情",@"评价"]];
}
-(void)setUpNavBar{


    UILabel *title_label = [HMLabel createLabelWithText:@"商品详情" andTextColor:[UIColor whiteColor] andBgColor:nil andFont:[UIFont fontWithName:default_fontname size:autoScaleW(20)] andTextAlignment:NSTextAlignmentCenter];

    title_label.frame = CGRectMake(0, 0, 100, 35);

    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav_bgimage"] forBarMetrics:UIBarMetricsDefault];

    self.navigationItem.titleView = title_label;



    UIButton *leftBtn = [HMButton createButtonWithTitle:@"" andTitleColor:nil andBgColor:nil andImage:[UIImage imageNamed:@"icon_arrow_left_white"] andBgImage:nil andSelecter:@selector(clickButton:) andTarget:self andTag:101];
        leftBtn.frame = CGRectMake(0, 0, autoScaleW(60), autoScaleW(30));
    [leftBtn setImageEdgeInsets:UIEdgeInsetsMake(autoScaleH(7), 0, autoScaleH(7), autoScaleW(50))];

    UIBarButtonItem *leftItem = [[UIBarButtonItem alloc]initWithCustomView:leftBtn];

    [self.navigationItem setLeftBarButtonItem:leftItem];


}

-(void)clickButton:(UIButton *)button{

  [self.navigationController popViewControllerAnimated:YES];


}

@end
